

<?php
//$ad = $this->db->where("position","footer_pic")->from('ad')->get()->row();
if(!empty($ad)){
    if(
        isset($this->user->id)
        &&   isset($article->id)
    ){
        $user_id = $this->user->id;
        if($user_id > 0){
            $this->load->model('Adaccount');
            $adaccount = new Adaccount();
            $adaccount->add_view($ad->id,$user_id);
        }
    }
    ?>

    <script type="text/html"  id="ad_position_3">
        <br>
        <img
                onclick="location.href='<?php t_(isset($ad->url)?$ad->url:'')?>'"
                style="width: 100%;height: 100%;"
                src="<?php t_(isset($ad->pic)?$ad->pic:'')?>"  alt="">
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
    </script>
    <script>
        $("#page-content").append($("#ad_position_3").html());
    </script>

    <?php
}
?>
